import 'package:flutter/material.dart';
import 'MovieScroll.dart';
import '../data/CustomData.dart';

class HomeBody extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // 可以排列不考虑溢出  column 上下放 考虑溢出
    return ListView (
      children: <Widget>[
        HomeBodyArea(title: '最新电影'),
        HomeBodyArea(title: '最新电视剧'),
        HomeBodyArea(title: '最新动漫'),
        HomeBodyArea(title: '最新综艺')
      ],
    );
  }
}

class HomeBodyArea extends StatelessWidget {
  HomeBodyArea({Key key,@required this.title}):super(key:key);
  final String title;
  @override
  Widget build(BuildContext context) {
    return Container(
      child: Column(
        // 排列
        // mainAxisAlignment: 指的是主轴,
        // crossAxisAlignment: 指的是副轴,
        children: <Widget>[
          Padding(
            padding: EdgeInsets.only(left: 5, right: 5),
            child: Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Text(this.title, style: TextStyle(
                  fontSize: 18,
                  height: 1.5
                ),),
                Text('更多>>', style: TextStyle(
                  color: Colors.blue
                ),)
              ],
            ),
          ),
          // 无缝滚动 
          MovieScroll()
        ],
      ),
    );
  }
}